<template>
	<view class="rule">
		<rich-text :nodes="ruleContent"></rich-text>
	</view>
</template>

<script>
	import config from "@/common/js/config.js";
	// import htmlParser from '@/common/js/html-parser';
	export default {
		data() {
			return {
				webUrl: '',
				content:{},
			}
		},
		computed:{
			ruleContent(){
				return this.content.content; // htmlParser(this.content.content);
			}
		},
		onLoad(options) {
			this.webUrl = options.url;
			this.getContent();
		},
		methods: {
			async getContent(){
				const res = await this.$api.sendRequest({
					url: this.webUrl,
					data: {
						fid: this.boxId
					},
					async: false
				});
				if(res.code>=0){
					uni.setNavigationBarTitle({
					　　title:res.data.title
					})
					this.content = res.data;
				}else{
					uni.showToast({
						title:res.message,
						icon:'none'
					})
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.rule {
		padding: 43rpx 35rpx;
		box-sizing: border-box;
		line-height: 49rpx;
		color: #444444;
	}
</style>
